package com.xt.purchasingsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xt.purchasingsystem.dto.BuyerPlanDetailDto;
import com.xt.purchasingsystem.mapper.BuyerPlanDetailMapper;
import com.xt.purchasingsystem.model.BuyerPlanDetail;
import com.xt.purchasingsystem.service.BuyerPlanDetailService;
import com.xt.purchasingsystem.utils.Result;
import com.xt.purchasingsystem.utils.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author yhp
 * @since 2020-05-31
 */
@Service
@Transactional
public class BuyerPlanDetailServiceImpl extends ServiceImpl<BuyerPlanDetailMapper, BuyerPlanDetail> implements BuyerPlanDetailService {
    @Autowired
    private BuyerPlanDetailMapper buyerPlanDetailMapper;


    @Override
    public Result getAllNOExecuteByPage(BuyerPlanDetailDto buyerPlanDetailDto) {

        PageHelper.startPage(buyerPlanDetailDto.getCurrNo(),buyerPlanDetailDto.getPageSize());
        List<BuyerPlanDetail> allNOExecuteByPage = buyerPlanDetailMapper.getAllNOExecuteByPage(buyerPlanDetailDto);
        PageInfo<BuyerPlanDetail> pageInfo=new PageInfo<>(allNOExecuteByPage);
        return ResultFactory.buildSuccessResult("查询成功", pageInfo);
    }
}
